package net.sxnic.item.mdata.action;

import net.sxnic.item.mdata.Mdata;
import net.sxnic.workflow.conf.WfConfigUtils;
import net.sxnic.workflow.context.WfContextImpl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("serial")
public class PreCreate extends MdataAction{
	
	private Logger logger = LoggerFactory.getLogger(PreCreate.class);
	
	public String execute() throws Exception{	
		
		try {
			context = new WfContextImpl();
			mdata = new Mdata();
			treatYCC();
			logger.debug("==={}={}==",catalogAlias,catalogCode);
			//提取流程		
			context.setTaskName(WfConfigUtils.findStartNodeName(catalogAlias));
			context.setProcessName(catalogAlias);
			mdata.setAppYear(appYear);
			mdata.setCatalog1(catalogAlias);
			mdata.setCatalog2(catalogCode);
			
			context.setEntity(mdata);
			
			//JSP对应的页面年份
			jspYear= dyManager.findJspYear(appYear, catalogAlias, catalogCode);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		logger.debug("===流程：==={}={}==started===",catalogAlias,catalogCode);
				
		return SUCCESS;
	}

}
